<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Vue</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>

<div id="app_axios">
    <input type="button" value="Get 请求" @click="getInfoGet"><br/>
    <input type="button" value="Post 请求" @click="getInfoPost">
</div>

<script>
    let v = new Vue({
        el: '#app_axios',
        data: {},
        methods: {
            getInfoGet() {
                axios.get('http://localhost:8080/find/get', {params: {id: 2}}).then(response => {
                    console.log(response)
                }).catch(response => {
                    console.log(response)
                })
            },
            getInfoPost() {
                //axios  Post，参数传过去是一个 json  @RequestParam 就会找不到id
                axios.post('http://localhost:8080/find/post_axios', {id: 1}).then(response => {
                    console.log(response)
                }).catch(response => {
                    console.log(response)
                })
            }
        }
    });
</script>

</body>
</html>